]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
userWidget: Add empty label when user is null
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 11 Feb 2020 13:39:22 +0000 (10:39 -0300)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 12 Feb 2020 19:29:48 +0000 (19:29 +0000)
Currently, when a null user is passed, we don't add any
username label. That makes the layout of user and no-user
cases inconsistent.

Add a ghost label with no opacity to mimic the username
label.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/922

js/ui/userWidget.js

index d21552555c8aed45c25528df1e3e32ef9d3fe11a..e5f7883381e8ca83aa267fec2513743433035f04 100644 (file)
@@ -225,6 +225,14 @@ class UserWidget extends St.BoxLayout {
 
             this._userLoadedId = this._user.connect('notify::is-loaded', this._updateUser.bind(this));
             this._userChangedId = this._user.connect('changed', this._updateUser.bind(this));
+        } else {
+            this._label = new St.Label({
+                style_class: 'user-widget-label',
+                text: 'Empty User',
+                opacity: 0,
+            });
+            this.add_child(this._label);
+
         }
 
         this._updateUser();